/**
 *
 */
if(typeof (module) !="undefined"){
    module.exports = FImageFilter; //

    var FEffectBase = require('./FEffectBase');
    var FFilterBase = require('./FFilterBase');

}



function FImageFilter()
{
    FFilterBase.call(this);
    this.type = FEffectBase.prototype.TYPE_IMAGE_FILTER;


    this.f = FImageFilter.prototype.IMAGE_FILTER_NONE;

}
FImageFilter.prototype = new FFilterBase();

// 图像滤镜
FImageFilter.prototype.IMAGE_FILTER_NONE=  0;// 无
FImageFilter.prototype.IMAGE_FILTER_OLD=  1;//老照片  "old":
FImageFilter.prototype.IMAGE_FILTER_BLACKWHITE= 2 ;//黑白 "blackWhite":
FImageFilter.prototype.IMAGE_FILTER_INCREASING= 3;//增强 "incresing":
FImageFilter.prototype.IMAGE_FILTER_WHITENING= 4;//美化 "whitening":
FImageFilter.prototype.IMAGE_FILTER_INVERSE= 5;//反色 "inverse":
FImageFilter.prototype.IMAGE_FILTER_PAPERBW= 6;//黑白报纸  "paperBW":
FImageFilter.prototype.IMAGE_FILTER_CONTRAST= 7;//对比 "contrast":


// 从json对象(注意不是json字符串)中解析
FImageFilter.prototype.fromJson = function(jsonObj, versionId){
    FFilterBase.prototype.fromJson.call(this,jsonObj,versionId);

    this.f = jsonObj.f;

}
// 转换成json字符串
FImageFilter.prototype.toJson = function(){
    // 去掉父json字符串的头尾
    var superJson = FFilterBase.prototype.toJson.call(this);
    superJson = superJson.substr(1,superJson.length-2);

    var ret = '{';
    ret +=superJson;

    // f
    ret +=',';
    ret += '"f":';
    ret += this.f;


    ret+='}';
    return ret;
}

